package cn.claim.storage.tools;

/**
 * Created by claim on 17-7-13.
 */
public final class NodeDataBuilder {
    private String ip;
    private int uploadPort;
    private int downloadPort;
    private int queryPort;
    private long totalVolume;
    private long spareSpace;
    private String name;

    private NodeDataBuilder() {
    }

    public static NodeDataBuilder newInstance() {
        return new NodeDataBuilder();
    }

    public NodeDataBuilder withIp(String ip) {
        this.ip = ip;
        return this;
    }

    public NodeDataBuilder withUploadPort(int uploadPort) {
        this.uploadPort = uploadPort;
        return this;
    }

    public NodeDataBuilder withDownloadPort(int downloadPort) {
        this.downloadPort = downloadPort;
        return this;
    }

    public NodeDataBuilder withQueryPort(int queryPort) {
        this.queryPort = queryPort;
        return this;
    }

    public NodeDataBuilder withSpareSpace(long spareSpace) {
        this.spareSpace = spareSpace;
        return this;
    }

    public NodeDataBuilder withName(String name) {
        this.name = name;
        return this;
    }

    public NodeDataBuilder withToTalVolume(long totalVolume) {
        this.totalVolume = totalVolume;
        return this;
    }

    public NodeData build() {
        NodeData nodeData = new NodeData(ip, uploadPort, downloadPort, queryPort, spareSpace, name, totalVolume);
        return nodeData;
    }
}
